Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-resizing to <perspective-viewer> #1633

Merged
merged 1 commit into from
Dec 2, 2021
Merged

Add auto-resizing to <perspective-viewer> #1633

merged 1 commit into from
Dec 2, 2021

Conversation

texodus
Copy link
Member

@texodus texodus commented Nov 28, 2021

Adds auto-reiszing behavior (on by default) to <perspective-viewer>, via an internal ResizeHandler on these elements. As a result, notifyResize() is no longer needed for resizing strictly and will likely eventually be removed as it can lead to duplicate re-renders. For now, it has been preserved and behavior modified slightly - calling notifyResize() when auto-sizing is enabled will log a warning and disable auto-size, unless the force bool argument is provided.

Auto size behavior can be disabled, reverting to the old manual resize logic via notifyResize() (which will not warn in this case), by calling setAutoSize(false):

elem = document.querySelector("perspective-viewer");
elem.setAutoSize(false);
elem.notifyResize(); // No warning

@texodus texodus added the enhancement Feature requests or improvements label Nov 28, 2021
@texodus texodus marked this pull request as draft November 28, 2021 22:48
@timkpaine
Copy link
Member

I think the windows build got hung so i force cancelled it, but the webassembly build failed with:

Summary of all failing tests
 FAIL  packages/perspective-viewer-datagrid/test/js/superstore.spec.js (9.376s)
  ● superstore.html › pivot › by two rows and two columns

    expect(received).toBe(expected) // Object.is equality

    Expected: "cdaa134913bd6cae25d335ec477d5606"
    Received: "20da969a8500883c68e74abbc6de7ff3"

@texodus texodus marked this pull request as ready for review December 2, 2021 22:32
@texodus texodus changed the title Add auto-resizing to <perspective-viewer> and <perspective-workspace> Add auto-resizing to <perspective-viewer> Dec 2, 2021
@texodus texodus merged commit 0bd2cfc into master Dec 2, 2021
@texodus texodus deleted the auto-resize branch December 2, 2021 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants